import { lazy } from 'react';

export const mainRoute = [
    {
        path:'/Home/Index',
        element:lazy(()=>import('../Page/Home/Index')),
        txt:'推荐',
    },
    {
        path:'/Home/New',
        element:lazy(()=>import('../Page/Home/New')),
        txt:'最新',
    },
    {
        path:'/Home/Sort',
        element:lazy(()=>import('../Page/Home/Sort')),
        txt:'排行',
    },
    {
        path:'/Home/Classify',
        element:lazy(()=>import('../Page/Home/Classify')),
        txt:'分类',
    },
    {
        path:'/Home/LunTan',
        element:lazy(()=>import('../Page/Home/LunTan')),
        txt:'论坛',
    },
]

const routes = [
    {
        path:'/Home',
        element:lazy(()=>import('../Page/Home')),
        children:mainRoute
    },
    {
        path:'/Detail/:id',
        element:lazy(()=>import('../Page/Detail'))
    },
    {
        path:'/Login',
        element:lazy(()=>import('../Page/Login'))
    },
    {
        path:'*',
        element:lazy(()=>import('../Page/Erroy404'))
    },
    {
        path:'/',
        to:'/Home/Index'
    }
]

export default routes
